﻿<Window x:Class="Analyzer.UI.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"        
        Title="MainWindow" Height="500" Width="800"
        Icon="Icons\see-waste.png">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="MainWindowResourceDictionary.xaml"/>                
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>        
    </Window.Resources>
    <Grid Margin="2,2,2,2" Background="WhiteSmoke">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width=".8*"/>
            <ColumnDefinition Width="3*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height=".5*"/>
            <RowDefinition Height="3.5*"/>
            <RowDefinition Height=".15*"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0" Grid.Column="1" Margin="2,2,2,2" Background="#ff333333">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width=".35*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Menu Margin="2,2,2,0" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0" Foreground="WhiteSmoke"
                  Background="Transparent" BorderBrush="Transparent" HorizontalAlignment="Stretch" 
                  FontFamily="Buxton Sketch" FontSize="18">          
                
                <MenuItem Header="_Participate" Background="#ff595959">
                    <MenuItem Header="_ReportBug" Command="{Binding ReportBugCommand}" Background="#ff595959">
                        <MenuItem.Icon>
                            <Image Source="Icons/bug-icon.png" Width="20" Height="20" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="_Join" Command="{Binding JoinCommand}" Background="#ff595959">
                        <MenuItem.Icon>
                            <Image Source="Icons/paypal-icon.png" Width="20" Height="20" />
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>
                <MenuItem Header="_Help" Background="#ff595959">
                    <MenuItem Header="_Documentation" Command="{Binding ShowDocumentationCommand}" Background="#ff595959">
                        <MenuItem.Icon>
                            <Image Source="Icons/User-Files-icon.png" Width="20" Height="20" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="_About" Command="{Binding ShowAboutCommand}" Background="#ff595959" >
                        <MenuItem.Icon>
                            <Image Source="Icons/About-icon.png" Width="20" Height="20" />
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>
                <!--<Menu IsMainMenu="True" Background="#ff595959" BorderBrush="Transparent" Foreground="WhiteSmoke"
                      HorizontalAlignment="Stretch">-->
                   

                <!--</Menu>-->                
            </Menu>
            
            <DockPanel Margin="2,2,2,2" Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Background="Transparent">
              
                <TextBlock Text="DART" FontFamily="Buxton Sketch" VerticalAlignment="Center"
                           HorizontalAlignment="Center" FontSize="70" Foreground="WhiteSmoke"/>
                <TextBlock Text="Device Analysis &amp; Reporting Tool " FontFamily="Buxton Sketch" VerticalAlignment="Bottom"
                           FontSize="20" Foreground="WhiteSmoke"/>
                <TextBlock Text="http://www.dart.codeplex.com/" FontFamily="Buxton Sketch" VerticalAlignment="Bottom"
                           FontSize="20" Foreground="WhiteSmoke" HorizontalAlignment="Right"/>                
            </DockPanel>            
        </Grid>           
        
        <Border BorderBrush="Brown" BorderThickness="1" Grid.Column="0" Margin="2,2,2,2"
                Grid.Row="0" Grid.RowSpan="2" Background="WhiteSmoke">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height=".5*"/>
                    <RowDefinition Height="3.5*"/>
                </Grid.RowDefinitions>
                <DockPanel Grid.Row="0" >                    
                    <Button ToolTipService.HasDropShadow="True" Background="Transparent" 
                            BorderBrush="Transparent" Command="{Binding GoBackCommand}"
                            IsEnabled="{Binding IsBackButtonEnabled}" ToolTip="Go up/back">
                        <Image Source="Icons/Back.png" />                        
                    </Button>
                    <Button ToolTipService.HasDropShadow="True" Background="Transparent" ToolTip="Go forward"
                            BorderBrush="Transparent" Command="{Binding TreeViewExplodeCommand}">
                        <Image Source="Icons/Forward.png" />
                    </Button>
                    <Button ToolTipService.HasDropShadow="True" Background="Transparent" ToolTip="Analyze Folder"
                            BorderBrush="Transparent" Command="{Binding AnalyzeCommand}" >
                        <Image Source="Icons/Analyze.png"/>
                    </Button>                    
                </DockPanel>               
                <StackPanel Grid.Row="1" DataContext="{Binding}" Background="Transparent">
                    <Separator Background="SlateGray" HorizontalAlignment="Stretch"/>                    
                    <ItemsControl Background="Transparent" ItemsSource="{Binding MyComputer}"/>                   
                </StackPanel>                
            </Grid>
        </Border>
        <Border BorderBrush="Brown" BorderThickness="0" Grid.Column="1" Margin="2,2,2,2"
                Grid.Row="1">
            <TabControl ItemsSource="{Binding WorkSpaces}" VerticalAlignment="Stretch"
                    ItemTemplate="{StaticResource ClosableTabItemTemplate}"
                    IsSynchronizedWithCurrentItem="True" SelectedItem="{Binding SelectedItem}"/>
        </Border>

        <DockPanel  Grid.Column="0" 
                    Grid.Row="2"
                    DataContext="{Binding StatusBar}" 
                    VerticalAlignment="Center">                            
            <ItemsControl ItemsSource="{Binding StatusAnimation, Mode=TwoWay}" 
                          Background="Transparent" Margin="2,0,0,0"
                          HorizontalAlignment="Left"/>
        </DockPanel>

        <DockPanel Grid.Column="1" Grid.Row="2"
                   DataContext="{Binding StatusBar}">
            
            <TextBlock Style="{StaticResource StatusBarTextBlock}" 
                       FontFamily="Buxton Sketch"
                       ToolTip="{Binding DetailedStatusMessage}"
                       Text="{Binding DetailedStatusMessage}" />
        </DockPanel>

        <DockPanel LastChildFill="False" Grid.Column="2" Grid.Row="2"
                   HorizontalAlignment="Right" DataContext="{Binding StatusBar}">
            <!--<Separator DockPanel.Dock="Left" 
                       Width="100" 
                       Background="Transparent"
                       BorderBrush="Transparent"/>-->
            <Image DockPanel.Dock="Left" 
                   Source="{Binding StatusMessageType, Converter={StaticResource ElementTypeToImageConverter}}" />
            <Separator DockPanel.Dock="Left" Width="5" 
                       Background="Transparent"
                       BorderBrush="Transparent"/>
            <TextBlock Style="{StaticResource StatusBarTextBlock}" 
                       VerticalAlignment="Center"
                       HorizontalAlignment="Right" 
                       FontSize="15" 
                       FontFamily="Buxton Sketch"
                       ToolTip="{Binding StatusMessage}" 
                       Text="{Binding StatusMessage}" />
        </DockPanel>
        
    </Grid>
</Window>
